/*
    This is a set of libraries to assist in OpenGl and Other Applications
    Copyright (C) 2008  The Modular Engine Team

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/// \file ModuleBase.h
/// \brief Contains abstract class that acts as parent to ALL other modules

#ifndef MODULEBASE_H
#define MODULEBASE_H
#include "Singleton.h" // allows singleton use for all modules

#define BASE(x) public ModuleBase, public Singleton<x>
// BASE(x) macro for allowing easily repeatable inclusion of both
// Singleton and ModuleBase
#define THROWERROR(x) ModularEngine::EngineCore::getSingleton().throwError( x, __FILE__, __LINE__ );
// ERROR(x) macro for easily calling throwError routine from any part of code.

//
// This class will act as the base class for any "routine" added 
// to the module routine.
//

namespace ModularEngine
{
	
	class ModuleBase
	{
	protected:
		unsigned int m_iIdentifier; // Unique identifier assigned to class.
	public:
		// default initializer for class
		virtual int initialize() = 0; 
		// run the module
		virtual int run() = 0; 
	};

}

#endif
